import { Injectable } from '@angular/core';
import {BehaviorSubject, Observable} from 'rxjs';

export  interface DragData {
  tag:string;
  data:any;
  
}
@Injectable({
  providedIn: 'root'
})

export class DirectiveService {

  constructor() { }
  private _dragData = new BehaviorSubject<DragData>(null)

    setDragData(data:DragData) {
      this._dragData.next(data);
    }

    getData():Observable<DragData> {
      return this._dragData.asObservable();
    }
    
    clearDragData() {
      this._dragData.next(null);
    }
}
